package com.ysynzehao.service;

import com.ysynzehao.bean.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.query.Param;

import java.util.List;
import java.util.Map;

/**
 * niuzehao
 * 2018/11/30 18:05.
 */
public interface UserService {

    User saveUser(User user);

    User getUser(int userId);

    User updateUser(User user);

    void deleteUser(int userId);

    Page<User> getAllUser(Pageable pageable);

    Page<User> getAllUser2(Pageable pageable, User user);

    List<Map> getUserMap();

    List<User> findByAgeIsLessThanAndUserNameLike(int age, String userName);

    List<User> findByUserNameHql(String userName);

    List<Map<Integer, String>> findUserIdNameMap();

    List<User> findByUserNameAndAgeSql(String userName, int age);

}
